//
//  AddViewController.m
//  TenThousand
//
//  Created by 我的 on 16/6/21.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "AddViewController.h"
#import "BankInformationViewController.h"

@interface AddViewController ()
@property (weak, nonatomic) IBOutlet UITextField *userName;
@property (weak, nonatomic) IBOutlet UITextField *cardNo;
@property (weak, nonatomic) IBOutlet UIButton *agreeBtn;

@property (weak, nonatomic) IBOutlet UIButton *nextBtn;
@end

@implementation AddViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"添加银行卡";
    [self createLeft:[UIImage imageNamed:@"ZHSZicon_03"] leftClick:^{
        [self.navigationController popViewControllerAnimated:YES];
    } right:nil rightClick:nil];
    
    self.agreeBtn.selected = YES;//默认为选中
}
- (IBAction)nextbtn:(id)sender {
    BankInformationViewController *bankInforView = [[BankInformationViewController alloc] init];
    bankInforView.userName = _userName.text;
    bankInforView.cardNo = _cardNo.text;
    NSLog(@"%@ %@",bankInforView.userName,bankInforView.cardNo);
    [self.navigationController pushViewController:bankInforView animated:YES];
}

- (IBAction)agreeBtn:(UIButton *)sender {
    
    if (sender.selected) {
        sender.selected = NO;
        _nextBtn.enabled = NO;
    }else{
        sender.selected = YES;
        _nextBtn.enabled = YES;
    }
}



@end
